{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sklearn.preprocessing import OneHotEncoder\n",
    "from sklearn.preprocessing import LabelEncoder\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FTR</th>\n",
       "      <th>HTGS</th>\n",
       "      <th>ATGS</th>\n",
       "      <th>HTGC</th>\n",
       "      <th>ATGC</th>\n",
       "      <th>HTP</th>\n",
       "      <th>ATP</th>\n",
       "      <th>HM1</th>\n",
       "      <th>HM2</th>\n",
       "      <th>HM3</th>\n",
       "      <th>...</th>\n",
       "      <th>HTLossStreak5</th>\n",
       "      <th>ATWinStreak3</th>\n",
       "      <th>ATWinStreak5</th>\n",
       "      <th>ATLossStreak3</th>\n",
       "      <th>ATLossStreak5</th>\n",
       "      <th>HTGD</th>\n",
       "      <th>ATGD</th>\n",
       "      <th>DiffPts</th>\n",
       "      <th>DiffFormPts</th>\n",
       "      <th>DiffLP</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>H</td>\n",
       "      <td>0.444444</td>\n",
       "      <td>0.455696</td>\n",
       "      <td>0.739726</td>\n",
       "      <td>0.826087</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>L</td>\n",
       "      <td>W</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.514286</td>\n",
       "      <td>-0.600000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.342857</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>H</td>\n",
       "      <td>0.580247</td>\n",
       "      <td>0.481013</td>\n",
       "      <td>0.506849</td>\n",
       "      <td>0.855072</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>L</td>\n",
       "      <td>D</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>-0.600000</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>-11.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NH</td>\n",
       "      <td>0.728395</td>\n",
       "      <td>0.405063</td>\n",
       "      <td>0.465753</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>L</td>\n",
       "      <td>L</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.714286</td>\n",
       "      <td>-0.400000</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>-16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>H</td>\n",
       "      <td>0.345679</td>\n",
       "      <td>0.594937</td>\n",
       "      <td>0.684932</td>\n",
       "      <td>0.376812</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>W</td>\n",
       "      <td>D</td>\n",
       "      <td>L</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.628571</td>\n",
       "      <td>0.600000</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>H</td>\n",
       "      <td>0.506173</td>\n",
       "      <td>0.493671</td>\n",
       "      <td>0.602740</td>\n",
       "      <td>0.608696</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>W</td>\n",
       "      <td>L</td>\n",
       "      <td>D</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.085714</td>\n",
       "      <td>-0.085714</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 30 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "  FTR      HTGS      ATGS      HTGC      ATGC       HTP       ATP HM1 HM2 HM3  \\\n",
       "0   H  0.444444  0.455696  0.739726  0.826087  0.000000  0.000000   L   W   W   \n",
       "1   H  0.580247  0.481013  0.506849  0.855072  0.000000  0.028571   L   D   W   \n",
       "2  NH  0.728395  0.405063  0.465753  0.666667  0.000000  0.028571   L   L   W   \n",
       "3   H  0.345679  0.594937  0.684932  0.376812  0.085714  0.028571   W   D   L   \n",
       "4   H  0.506173  0.493671  0.602740  0.608696  0.085714  0.028571   W   L   D   \n",
       "\n",
       "    ...   HTLossStreak5 ATWinStreak3 ATWinStreak5 ATLossStreak3 ATLossStreak5  \\\n",
       "0   ...               0            0            0             1             1   \n",
       "1   ...               0            0            0             0             0   \n",
       "2   ...               0            0            0             1             0   \n",
       "3   ...               0            0            0             0             0   \n",
       "4   ...               0            0            0             0             0   \n",
       "\n",
       "       HTGD      ATGD   DiffPts  DiffFormPts  DiffLP  \n",
       "0 -0.514286 -0.600000  0.000000     0.342857     0.0  \n",
       "1  0.285714 -0.600000 -0.028571    -0.028571   -11.0  \n",
       "2  0.714286 -0.400000 -0.028571     0.142857   -16.0  \n",
       "3 -0.628571  0.600000  0.057143     0.000000    -5.0  \n",
       "4 -0.085714 -0.085714  0.057143     0.142857     7.0  \n",
       "\n",
       "[5 rows x 30 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data=pd.read_csv(\"datasets\\\\final_dataset.csv\")\n",
    "dataT=pd.read_csv(\"datasets\\\\test.csv\")\n",
    "data.head()\n",
    "dataT.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FTR</th>\n",
       "      <th>HTGS</th>\n",
       "      <th>ATGS</th>\n",
       "      <th>HTGC</th>\n",
       "      <th>ATGC</th>\n",
       "      <th>HTP</th>\n",
       "      <th>ATP</th>\n",
       "      <th>HM1</th>\n",
       "      <th>HM2</th>\n",
       "      <th>HM3</th>\n",
       "      <th>...</th>\n",
       "      <th>HTLossStreak5</th>\n",
       "      <th>ATWinStreak3</th>\n",
       "      <th>ATWinStreak5</th>\n",
       "      <th>ATLossStreak3</th>\n",
       "      <th>ATLossStreak5</th>\n",
       "      <th>HTGD</th>\n",
       "      <th>ATGD</th>\n",
       "      <th>DiffPts</th>\n",
       "      <th>DiffFormPts</th>\n",
       "      <th>DiffLP</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0.444444</td>\n",
       "      <td>0.455696</td>\n",
       "      <td>0.739726</td>\n",
       "      <td>0.826087</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>L</td>\n",
       "      <td>W</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.514286</td>\n",
       "      <td>-0.600000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.342857</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0.580247</td>\n",
       "      <td>0.481013</td>\n",
       "      <td>0.506849</td>\n",
       "      <td>0.855072</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>L</td>\n",
       "      <td>D</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>-0.600000</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>-11.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0.728395</td>\n",
       "      <td>0.405063</td>\n",
       "      <td>0.465753</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>L</td>\n",
       "      <td>L</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.714286</td>\n",
       "      <td>-0.400000</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>-16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0.345679</td>\n",
       "      <td>0.594937</td>\n",
       "      <td>0.684932</td>\n",
       "      <td>0.376812</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>W</td>\n",
       "      <td>D</td>\n",
       "      <td>L</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.628571</td>\n",
       "      <td>0.600000</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0.506173</td>\n",
       "      <td>0.493671</td>\n",
       "      <td>0.602740</td>\n",
       "      <td>0.608696</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>W</td>\n",
       "      <td>L</td>\n",
       "      <td>D</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.085714</td>\n",
       "      <td>-0.085714</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 30 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   FTR      HTGS      ATGS      HTGC      ATGC       HTP       ATP HM1 HM2  \\\n",
       "0    0  0.444444  0.455696  0.739726  0.826087  0.000000  0.000000   L   W   \n",
       "1    0  0.580247  0.481013  0.506849  0.855072  0.000000  0.028571   L   D   \n",
       "2    1  0.728395  0.405063  0.465753  0.666667  0.000000  0.028571   L   L   \n",
       "3    0  0.345679  0.594937  0.684932  0.376812  0.085714  0.028571   W   D   \n",
       "4    0  0.506173  0.493671  0.602740  0.608696  0.085714  0.028571   W   L   \n",
       "\n",
       "  HM3   ...   HTLossStreak5 ATWinStreak3 ATWinStreak5 ATLossStreak3  \\\n",
       "0   W   ...               0            0            0             1   \n",
       "1   W   ...               0            0            0             0   \n",
       "2   W   ...               0            0            0             1   \n",
       "3   L   ...               0            0            0             0   \n",
       "4   D   ...               0            0            0             0   \n",
       "\n",
       "  ATLossStreak5      HTGD      ATGD   DiffPts  DiffFormPts  DiffLP  \n",
       "0             1 -0.514286 -0.600000  0.000000     0.342857     0.0  \n",
       "1             0  0.285714 -0.600000 -0.028571    -0.028571   -11.0  \n",
       "2             0  0.714286 -0.400000 -0.028571     0.142857   -16.0  \n",
       "3             0 -0.628571  0.600000  0.057143     0.000000    -5.0  \n",
       "4             0 -0.085714 -0.085714  0.057143     0.142857     7.0  \n",
       "\n",
       "[5 rows x 30 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ftrLE=LabelEncoder()\n",
    "data.FTR=ftrLE.fit_transform(data.FTR)\n",
    "dataT.FTR=ftrLE.transform(dataT.FTR)\n",
    "dataT.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FTR</th>\n",
       "      <th>HTGS</th>\n",
       "      <th>ATGS</th>\n",
       "      <th>HTGC</th>\n",
       "      <th>ATGC</th>\n",
       "      <th>HTP</th>\n",
       "      <th>ATP</th>\n",
       "      <th>HM1</th>\n",
       "      <th>HM2</th>\n",
       "      <th>HM3</th>\n",
       "      <th>...</th>\n",
       "      <th>HTLossStreak5</th>\n",
       "      <th>ATWinStreak3</th>\n",
       "      <th>ATWinStreak5</th>\n",
       "      <th>ATLossStreak3</th>\n",
       "      <th>ATLossStreak5</th>\n",
       "      <th>HTGD</th>\n",
       "      <th>ATGD</th>\n",
       "      <th>DiffPts</th>\n",
       "      <th>DiffFormPts</th>\n",
       "      <th>DiffLP</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0.444444</td>\n",
       "      <td>0.455696</td>\n",
       "      <td>0.739726</td>\n",
       "      <td>0.826087</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "      <td>W</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.514286</td>\n",
       "      <td>-0.600000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.342857</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0.580247</td>\n",
       "      <td>0.481013</td>\n",
       "      <td>0.506849</td>\n",
       "      <td>0.855072</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>1</td>\n",
       "      <td>D</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>-0.600000</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>-11.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0.728395</td>\n",
       "      <td>0.405063</td>\n",
       "      <td>0.465753</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>1</td>\n",
       "      <td>L</td>\n",
       "      <td>W</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.714286</td>\n",
       "      <td>-0.400000</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>-16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0.345679</td>\n",
       "      <td>0.594937</td>\n",
       "      <td>0.684932</td>\n",
       "      <td>0.376812</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>3</td>\n",
       "      <td>D</td>\n",
       "      <td>L</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.628571</td>\n",
       "      <td>0.600000</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0.506173</td>\n",
       "      <td>0.493671</td>\n",
       "      <td>0.602740</td>\n",
       "      <td>0.608696</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>3</td>\n",
       "      <td>L</td>\n",
       "      <td>D</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.085714</td>\n",
       "      <td>-0.085714</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>7.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 30 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   FTR      HTGS      ATGS      HTGC      ATGC       HTP       ATP  HM1 HM2  \\\n",
       "0    0  0.444444  0.455696  0.739726  0.826087  0.000000  0.000000    1   W   \n",
       "1    0  0.580247  0.481013  0.506849  0.855072  0.000000  0.028571    1   D   \n",
       "2    1  0.728395  0.405063  0.465753  0.666667  0.000000  0.028571    1   L   \n",
       "3    0  0.345679  0.594937  0.684932  0.376812  0.085714  0.028571    3   D   \n",
       "4    0  0.506173  0.493671  0.602740  0.608696  0.085714  0.028571    3   L   \n",
       "\n",
       "  HM3   ...   HTLossStreak5 ATWinStreak3 ATWinStreak5 ATLossStreak3  \\\n",
       "0   W   ...               0            0            0             1   \n",
       "1   W   ...               0            0            0             0   \n",
       "2   W   ...               0            0            0             1   \n",
       "3   L   ...               0            0            0             0   \n",
       "4   D   ...               0            0            0             0   \n",
       "\n",
       "  ATLossStreak5      HTGD      ATGD   DiffPts  DiffFormPts  DiffLP  \n",
       "0             1 -0.514286 -0.600000  0.000000     0.342857     0.0  \n",
       "1             0  0.285714 -0.600000 -0.028571    -0.028571   -11.0  \n",
       "2             0  0.714286 -0.400000 -0.028571     0.142857   -16.0  \n",
       "3             0 -0.628571  0.600000  0.057143     0.000000    -5.0  \n",
       "4             0 -0.085714 -0.085714  0.057143     0.142857     7.0  \n",
       "\n",
       "[5 rows x 30 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hmLE=LabelEncoder()\n",
    "data.HM1=hmLE.fit_transform(data.HM1)\n",
    "dataT.HM1=hmLE.fit_transform(dataT.HM1)\n",
    "dataT.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.HM2=hmLE.fit_transform(data.HM2)\n",
    "data.HM3=hmLE.fit_transform(data.HM3)\n",
    "data.HM4=hmLE.fit_transform(data.HM4)\n",
    "data.HM5=hmLE.fit_transform(data.HM5)\n",
    "data.AM1=hmLE.fit_transform(data.AM1)\n",
    "data.AM2=hmLE.fit_transform(data.AM2)\n",
    "data.AM3=hmLE.fit_transform(data.AM3)\n",
    "data.AM4=hmLE.fit_transform(data.AM4)\n",
    "data.AM5=hmLE.fit_transform(data.AM5)\n",
    "\n",
    "dataT.HM2=hmLE.fit_transform(dataT.HM2)\n",
    "dataT.HM3=hmLE.fit_transform(dataT.HM3)\n",
    "dataT.HM4=hmLE.fit_transform(dataT.HM4)\n",
    "dataT.HM5=hmLE.fit_transform(dataT.HM5)\n",
    "dataT.AM1=hmLE.fit_transform(dataT.AM1)\n",
    "dataT.AM2=hmLE.fit_transform(dataT.AM2)\n",
    "dataT.AM3=hmLE.fit_transform(dataT.AM3)\n",
    "dataT.AM4=hmLE.fit_transform(dataT.AM4)\n",
    "dataT.AM5=hmLE.fit_transform(dataT.AM5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FTR</th>\n",
       "      <th>HTGS</th>\n",
       "      <th>ATGS</th>\n",
       "      <th>HTGC</th>\n",
       "      <th>ATGC</th>\n",
       "      <th>HTP</th>\n",
       "      <th>ATP</th>\n",
       "      <th>HM1</th>\n",
       "      <th>HM2</th>\n",
       "      <th>HM3</th>\n",
       "      <th>...</th>\n",
       "      <th>HTLossStreak5</th>\n",
       "      <th>ATWinStreak3</th>\n",
       "      <th>ATWinStreak5</th>\n",
       "      <th>ATLossStreak3</th>\n",
       "      <th>ATLossStreak5</th>\n",
       "      <th>HTGD</th>\n",
       "      <th>ATGD</th>\n",
       "      <th>DiffPts</th>\n",
       "      <th>DiffFormPts</th>\n",
       "      <th>DiffLP</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 30 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   FTR  HTGS  ATGS  HTGC  ATGC  HTP  ATP  HM1  HM2  HM3   ...    \\\n",
       "0    0   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...     \n",
       "1    1   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...     \n",
       "2    1   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...     \n",
       "3    1   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...     \n",
       "4    1   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...     \n",
       "\n",
       "   HTLossStreak5  ATWinStreak3  ATWinStreak5  ATLossStreak3  ATLossStreak5  \\\n",
       "0              0             0             0              0              0   \n",
       "1              0             0             0              0              0   \n",
       "2              0             0             0              0              0   \n",
       "3              0             0             0              0              0   \n",
       "4              0             0             0              0              0   \n",
       "\n",
       "   HTGD  ATGD  DiffPts  DiffFormPts  DiffLP  \n",
       "0   0.0   0.0      0.0          0.0   -15.0  \n",
       "1   0.0   0.0      0.0          0.0    10.0  \n",
       "2   0.0   0.0      0.0          0.0   -16.0  \n",
       "3   0.0   0.0      0.0          0.0    -1.0  \n",
       "4   0.0   0.0      0.0          0.0     5.0  \n",
       "\n",
       "[5 rows x 30 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1860, 30)\n",
      "(800, 30)\n"
     ]
    }
   ],
   "source": [
    "print(data.shape)\n",
    "print(dataT.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\krishna\\Anaconda3\\envs\\tensorflow\\lib\\site-packages\\ipykernel_launcher.py:2: FutureWarning: reshape is deprecated and will raise in a subsequent release. Please use .values.reshape(...) instead\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "OneHotEncoder(categorical_features='all', dtype=<class 'numpy.float64'>,\n",
       "       handle_unknown='error', n_values='auto', sparse=True)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "onehotencoder=OneHotEncoder()\n",
    "onehotencoder.fit(data.FTR.reshape(-1,1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "final=onehotencoder.transform([[each] for each in data.FTR]).toarray()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1860, 2)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "finalT=onehotencoder.transform([[each] for each in dataT.FTR]).toarray()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(800, 2)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "finalT.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.loc[:,\"final1\"]=final[:,0]\n",
    "data.loc[:,\"final2\"]=final[:,1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FTR</th>\n",
       "      <th>HTGS</th>\n",
       "      <th>ATGS</th>\n",
       "      <th>HTGC</th>\n",
       "      <th>ATGC</th>\n",
       "      <th>HTP</th>\n",
       "      <th>ATP</th>\n",
       "      <th>HM1</th>\n",
       "      <th>HM2</th>\n",
       "      <th>HM3</th>\n",
       "      <th>...</th>\n",
       "      <th>ATWinStreak5</th>\n",
       "      <th>ATLossStreak3</th>\n",
       "      <th>ATLossStreak5</th>\n",
       "      <th>HTGD</th>\n",
       "      <th>ATGD</th>\n",
       "      <th>DiffPts</th>\n",
       "      <th>DiffFormPts</th>\n",
       "      <th>DiffLP</th>\n",
       "      <th>final1</th>\n",
       "      <th>final2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-15.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-16.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 32 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   FTR  HTGS  ATGS  HTGC  ATGC  HTP  ATP  HM1  HM2  HM3   ...    ATWinStreak5  \\\n",
       "0    0   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...               0   \n",
       "1    1   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...               0   \n",
       "2    1   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...               0   \n",
       "3    1   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...               0   \n",
       "4    1   0.0   0.0   0.0   0.0  0.0  0.0    2    2    2   ...               0   \n",
       "\n",
       "   ATLossStreak3  ATLossStreak5  HTGD  ATGD  DiffPts  DiffFormPts  DiffLP  \\\n",
       "0              0              0   0.0   0.0      0.0          0.0   -15.0   \n",
       "1              0              0   0.0   0.0      0.0          0.0    10.0   \n",
       "2              0              0   0.0   0.0      0.0          0.0   -16.0   \n",
       "3              0              0   0.0   0.0      0.0          0.0    -1.0   \n",
       "4              0              0   0.0   0.0      0.0          0.0     5.0   \n",
       "\n",
       "   final1  final2  \n",
       "0     1.0     0.0  \n",
       "1     0.0     1.0  \n",
       "2     0.0     1.0  \n",
       "3     0.0     1.0  \n",
       "4     0.0     1.0  \n",
       "\n",
       "[5 rows x 32 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# data=data.drop([\"final\"],axis=1)\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "dataT.loc[:,\"final1\"]=finalT[:,0]\n",
    "dataT.loc[:,\"final2\"]=finalT[:,1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FTR</th>\n",
       "      <th>HTGS</th>\n",
       "      <th>ATGS</th>\n",
       "      <th>HTGC</th>\n",
       "      <th>ATGC</th>\n",
       "      <th>HTP</th>\n",
       "      <th>ATP</th>\n",
       "      <th>HM1</th>\n",
       "      <th>HM2</th>\n",
       "      <th>HM3</th>\n",
       "      <th>...</th>\n",
       "      <th>ATWinStreak5</th>\n",
       "      <th>ATLossStreak3</th>\n",
       "      <th>ATLossStreak5</th>\n",
       "      <th>HTGD</th>\n",
       "      <th>ATGD</th>\n",
       "      <th>DiffPts</th>\n",
       "      <th>DiffFormPts</th>\n",
       "      <th>DiffLP</th>\n",
       "      <th>final1</th>\n",
       "      <th>final2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0.444444</td>\n",
       "      <td>0.455696</td>\n",
       "      <td>0.739726</td>\n",
       "      <td>0.826087</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-0.514286</td>\n",
       "      <td>-0.600000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.342857</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0.580247</td>\n",
       "      <td>0.481013</td>\n",
       "      <td>0.506849</td>\n",
       "      <td>0.855072</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.285714</td>\n",
       "      <td>-0.600000</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>-11.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0.728395</td>\n",
       "      <td>0.405063</td>\n",
       "      <td>0.465753</td>\n",
       "      <td>0.666667</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0.714286</td>\n",
       "      <td>-0.400000</td>\n",
       "      <td>-0.028571</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>-16.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0.345679</td>\n",
       "      <td>0.594937</td>\n",
       "      <td>0.684932</td>\n",
       "      <td>0.376812</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.628571</td>\n",
       "      <td>0.600000</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-5.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0.506173</td>\n",
       "      <td>0.493671</td>\n",
       "      <td>0.602740</td>\n",
       "      <td>0.608696</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>-0.085714</td>\n",
       "      <td>-0.085714</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>7.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 32 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   FTR      HTGS      ATGS      HTGC      ATGC       HTP       ATP  HM1  HM2  \\\n",
       "0    0  0.444444  0.455696  0.739726  0.826087  0.000000  0.000000    1    3   \n",
       "1    0  0.580247  0.481013  0.506849  0.855072  0.000000  0.028571    1    0   \n",
       "2    1  0.728395  0.405063  0.465753  0.666667  0.000000  0.028571    1    1   \n",
       "3    0  0.345679  0.594937  0.684932  0.376812  0.085714  0.028571    3    0   \n",
       "4    0  0.506173  0.493671  0.602740  0.608696  0.085714  0.028571    3    1   \n",
       "\n",
       "   HM3   ...    ATWinStreak5  ATLossStreak3  ATLossStreak5      HTGD  \\\n",
       "0    3   ...               0              1              1 -0.514286   \n",
       "1    3   ...               0              0              0  0.285714   \n",
       "2    3   ...               0              1              0  0.714286   \n",
       "3    1   ...               0              0              0 -0.628571   \n",
       "4    0   ...               0              0              0 -0.085714   \n",
       "\n",
       "       ATGD   DiffPts  DiffFormPts  DiffLP  final1  final2  \n",
       "0 -0.600000  0.000000     0.342857     0.0     1.0     0.0  \n",
       "1 -0.600000 -0.028571    -0.028571   -11.0     1.0     0.0  \n",
       "2 -0.400000 -0.028571     0.142857   -16.0     0.0     1.0  \n",
       "3  0.600000  0.057143     0.000000    -5.0     1.0     0.0  \n",
       "4 -0.085714  0.057143     0.142857     7.0     1.0     0.0  \n",
       "\n",
       "[5 rows x 32 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# data=data.drop([\"final\"],axis=1)\n",
    "dataT.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(800, 2)"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataT[[\"final1\",\"final2\"]].values.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "data=data.drop([\"HM5\",\"AM5\"],axis=1)\n",
    "dataT=dataT.drop([\"HM5\",\"AM5\"],axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1860, 30)\n",
      "(800, 30)\n"
     ]
    }
   ],
   "source": [
    "print(data.shape)\n",
    "print(dataT.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.to_csv(\"allAtt_onehot_large_train.csv\",index=None)\n",
    "dataT.to_csv(\"allAtt_onehot_large_test.csv\",index=None)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
